#ifndef FORM_XXCX_H
#define FORM_XXCX_H

#include <QWidget>
#include <QNetworkAccessManager>
#include <QNetworkRequest>
#include <QNetworkReply>
#include <QNetworkInterface>
#include <QNetworkRequest>
#include <QJsonObject>
#include <QJsonArray>
#include <QSqlQuery>
#include <QMap>
#include <QSqlQueryModel>
#include <QListWidgetItem>
#include <QTimer>
#include "pub_pop_delay.h"

namespace Ui {
class Form_xxcx;
}

class Form_xxcx : public QWidget
{
    Q_OBJECT

public:
    explicit Form_xxcx(QWidget *parent = nullptr);
    ~Form_xxcx();
    void putBaseIn( QJsonObject &in, QString code);

signals:
    void destroyW( QString );

private slots:
    void closeEvent(QCloseEvent *event);

    void display5206();
    void call_5960(QJsonObject &inpu);
    void on_pb5201_clicked();
    void on_pb5202_clicked();
    void on_pb5203_clicked();
    void on_pbExit_clicked();

    void on_pbDycx_clicked();
    void on_pbInsu_clicked();

    void onTimeOut();

    void on_pbOwnPay_clicked();

    void on_tvPatient_doubleClicked(const QModelIndex &index);

    void on_tvPatient_clicked(const QModelIndex &index);

    void on_pbFymxZf_clicked();

    void on_pbJzxxZf_clicked();

    void on_pbZdxxZf_clicked();

    void on_pb5204_clicked();

    void on_cbbInvoice_currentTextChanged(const QString &arg1);

    void on_cbbJsid_currentTextChanged(const QString &arg1);

    void on_pb1101_clicked();

    void on_pb5206_clicked();

    void on_cb_thisyear_clicked();

    void on_cb_group_clicked();

    void on_deStart_dateChanged(const QDate &date);

    void on_pb9560_clicked();

    void on_tvResult_clicked(const QModelIndex &index);

    void on_pb_export_clicked();

private:
    Ui::Form_xxcx *ui;
    QSqlQuery *qrm, *qro, *qrot;
    QSqlQueryModel *mdPatient , *mdDownResult;

    QString sq;
    QString oinfno;
    QNetworkRequest request;
    QNetworkAccessManager manager ;
    QJsonArray ret5201;
    QJsonArray ret5202;
    QJsonArray ret5960;

    QJsonObject ret5203info;
    QJsonArray ret5203detail;

    QString psn_no;
    QString clinic_code;
    QString mdtrt_id;   //就诊ID

    QTimer *tm;
    QString curMsg;
    QString currentMsgid;
    QString name;   //患者姓名
    QString idenno; //身份证号
    QString current_query; //当前查询名称
    Pub_pop_delay * dlgDelay;
    bool isInsu;//工作模式
    bool has_insu_privilege;//医保操作权限
    QString last_query;
};

#endif // FORM_XXCX_H
